<?php
define('HOST', 'localhost');
define('USER', 'mes');
define('PASSWORD', '111111');
define('DATABASE', 'mes');
$id = $_REQUEST['id'];
$conn = mysqli_connect(HOST, USER, PASSWORD, DATABASE)or die('数据库连接失败：' . mysqli_connect_error());
$sql = "select * from liuyan where id=$id";
$res = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($res);
$content = $row['content'];
$name = $row['username'];
?>
<!DOCTYPE html>
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">    
    </head>
    <body>
        <form method="post" action="update.php" onsubmit="return check()">
            <input type="hidden" name="id" value="<?php echo $id ?>">
            <input type="text" name="mes" value="<?php echo $content ?>" placeholder="发表遗言">
            <input type="text" name="name" value="<?php echo $name ?>"  placeholder="用户名">
            <input type="submit" value="确认修改">
        </form>
        <script src="liuyan0.js" type="text/javascript"></script>
    </body>
</html>

